home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _ENUMPJ.FRM < prev    next >
Text File  |  1996-05-14  |  7KB  |  235 lines

  1. VERSION 4.00
  2. Begin VB.Form frmEnumPJ 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "EnumPrinterJobs"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5250
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4845
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4110
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7260
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7485
  37.       _Version        =   65536
  38.       _ExtentX        =   13203
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   4785
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7140
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6300
  71.          TabIndex        =   5
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   4
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6615
  96.          TabIndex        =   3
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. End
  110. Attribute VB_Name = "frmEnumPJ"
  111. Attribute VB_Creatable = False
  112. Attribute VB_Exposed = False
  113. Option Explicit
  114. Option Base 1
  115.  
  116. Private Const Iteration = 25
  117.  
  118. Dim IsLoaded         As Integer
  119.  
  120. Dim TimerStartOk     As Integer
  121. Dim TimerCloseOk     As Integer
  122.  
  123. Dim TimerHandle      As Integer
  124. Dim TimerValue       As Long
  125.  
  126. Private Sub cmb_Function_Click()
  127.    
  128.    If (IsLoaded = False) Then Exit Sub
  129.    
  130.    Call cDisableFI(mdiT2W.Picture1)
  131.    
  132.    txt_Result = ""
  133.    
  134.    DoEvents
  135.    
  136.    Select Case cmb_Function.ListIndex
  137.       Case 0
  138.          Call TestEnumPJ
  139.    End Select
  140.  
  141.    DoEvents
  142.    Call cEnableFI(mdiT2W.Picture1)
  143.    
  144. End Sub
  145.  
  146.  
  147. Private Sub cmdNP_Click(Index As Integer)
  148.  
  149.    Call sub_NextPrev(cmb_Function, Index)
  150.  
  151. End Sub
  152.  
  153. Private Sub Form_Activate()
  154.  
  155.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  156.  
  157. End Sub
  158.  
  159. Private Sub Form_Load()
  160.  
  161.    IsLoaded = False
  162.    
  163.    Show
  164.  
  165.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_enumpj.t2w")
  166.    
  167.    IsLoaded = True
  168.    
  169. End Sub
  170.  
  171. Private Sub SSCommand1_Click()
  172.    
  173.    Call cmb_Function_Click
  174.    
  175. End Sub
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184. Public Sub TestEnumPJ()
  185.  
  186.    Dim intResult        As Integer
  187.    Dim strDisplay       As String
  188.    
  189.    Dim i                As Integer
  190.    
  191.    strDisplay = ""
  192.    
  193.    Dim JI               As tagJOBINFO
  194.    
  195.    intResult = cEnumPrinterJobs("LPT1:", JI, True)
  196.    
  197.    Do While intResult = EPJ_SUCCESS
  198.    
  199.       strDisplay = strDisplay + "sPrinterName : '" & JI.sPrinterName & "'" & vbCrLf
  200.       strDisplay = strDisplay + "sMachineName : '" & JI.sMachineName & "'" & vbCrLf
  201.       strDisplay = strDisplay + "sUserName : '" & JI.sUserName & "'" & vbCrLf
  202.       strDisplay = strDisplay + "sDocument : '" & JI.sDocument & "'" & vbCrLf
  203.       strDisplay = strDisplay + "lJobId : " & JI.lJobId & vbCrLf
  204.       strDisplay = strDisplay + "lStatus : " & JI.lStatus & vbCrLf
  205.       strDisplay = strDisplay + "lPriority : " & JI.lPriority & vbCrLf
  206.       strDisplay = strDisplay + "lPosition : " & JI.lPosition & vbCrLf
  207.       strDisplay = strDisplay + "lStartTime : " & JI.lStartTime & vbCrLf
  208.       strDisplay = strDisplay + "lUntilTime : " & JI.lUntilTime & vbCrLf
  209.       strDisplay = strDisplay + "lTotalPages : " & JI.lTotalPages & vbCrLf
  210.       strDisplay = strDisplay + "lPagesPrinted : " & JI.lPagesPrinted & vbCrLf
  211.       strDisplay = strDisplay + "lSize : " & JI.lSize & vbCrLf
  212.       strDisplay = strDisplay + "lTime : " & JI.lTime & vbCrLf
  213.       strDisplay = strDisplay + "Submitted : " & JI.wMonth & "/" & JI.wDay & "/" & JI.wYear & " " & JI.wHour & ":" & JI.wMinute & ":" & JI.wSecond & vbCrLf & vbCrLf
  214.       
  215.       intResult = cEnumPrinterJobs("LPT1:", JI, False)
  216.    
  217.    Loop
  218.    
  219.    txt_Result = strDisplay
  220.  
  221.    'time the function
  222.  
  223.    TimerHandle = cTimerOpen()
  224.    TimerStartOk = cTimerStart(TimerHandle)
  225.    
  226.    For i = 1 To Iteration
  227.       intResult = cEnumPrinterJobs("LPT1:", JI, True)
  228.    Next i
  229.    
  230.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  231.    
  232.    TimerCloseOk = cTimerClose(TimerHandle)
  233.  
  234. End Sub
  235.